#include "patient.h"

QString Patient::getName() const {
  return name;
}

void Patient::setName(const QString & value) {
  name = value;
}

QString Patient::getId() const {
  return id;
}

void Patient::setId(const QString & value) {
  id = value;
}

QTreeWidgetItem *Patient::getTreeItem() const {
  QStringList data = {id, name };
  QTreeWidgetItem *item = new QTreeWidgetItem(data);
  foreach (Study s, study) {
    item->addChild(s.getTreeItem());
  }
  return item;
}

void Patient::addStudy(const Study & s) {
  study.push_back(s);
}
